<?php

function randf() { 
   return mt_rand() / mt_getrandmax(); 
}

function randdim($dim) {
    return randf() * $dim;
}


setlocale(LC_NUMERIC, 'C');
$size = $argv[1];
$maxspeed = $argv[2];

$dim = pow($size, 1/3) * 2;

echo $size . "\n";
echo "0 $dim\n";
echo "0 $dim\n";
echo "0 $dim\n";
echo "0\n";

for ($i = 0; $i < $size; $i++) {
    $pos = array(randdim($dim), randdim($dim), randdim($dim));
    $speed = array(randdim(0.3), randdim(0.3), randdim(0.3));

    printf("%.f %.f %.f\n%f %f %f\n", 
        $pos[0], $pos[1], $pos[2],
        $speed[0], $speed[1], $speed[2]
    );
}

?>
